//通用错误回调
function returnErr(ctx, msg = '参数错误',code = 40500){
    ctx.status = 500
    ctx.body = {
        "code": code,
        "data": {},
        "msg": msg
    }
}
//正常返回
function returnRight(ctx, result){
    ctx.status = 200
    ctx.body = {
        "code": "200",
        "data": result,
        "msg": null
    }
}

module.exports = {
    returnErr,
    returnRight
}
